import request from '@/utils/request'
// 获取小区名称
export function communityInfo() {
  return request({
    url: '/community',
    method: 'get'
  })
}
// 获取数据列表/查询
export function owersList(data) {
  return request({
    url: `/owners/member?current=${data.current}&pageSize=${data.pageSize}&create_time=${data.create_time}&name=${data.name}&identity_id=${data.identity_id}&tel=${data.tel}&gender=${data.gender}&owner_type=${data.owner_type}&community_code=${data.community_code}&building_code=${data.building_code}`,
    method: 'get'
  })
}
// 根据小区名称获取栋数信息

export function communityBuild(code) {
  return request({
    url: `/house/building?community_code=${code}`,
    method: 'get'
  })
}

// 查询所属房产
export function buildHouse(code) {
  return request({
    url: `house/index?building_code=${code}`,
    method: 'get'
  })
}
// 查询单个
export function getOwner(id) {
  return request({
    url: `owners/member/${id}`,
    method: 'GET'
  })
}
// 修改
export function editOwner(data) {
  return request({
    url: `owners/member/${data.id}`,
    method: 'PUT',
    data
  })
}

// 新增
export function addOwner(data) {
  return request({
    url: 'owners/member',
    method: 'POST',
    data
  })
}

// 删除
export function delOwner(id) {
  return request({
    url: `owners/member/${id}`,
    method: 'DELETE'
  })
}
